Object-oriented programming code includes the allocation and referencing of objects. For example, an object may be a variable, data structure, or function. One object may reference another object, e.g., using a pointer. When an object is allocated during execution of the programming code, memory is provided for that object. Memory usage is managed by tracking incoming references for each object. As references are removed from an object, the incoming reference count is decreased. Objects are flagged for garbage collection/deallocation when the incoming reference count of an object reaches zero. Two objects, however, may have a cycle of references between them and, if the only other incoming reference to one of the objects from elsewhere is moved or removed, the code may be left with two objects that refer to each other but are not reachable by a program variable or otherwise by the executed programming code. In such a scenario, this cycle of objects will leave two objects that should probably be deallocated but will not be flagged for garbage collection because each has an incoming reference count of one.